<?php

class Page {

    static private $_Page;

    public $pid;
    public $controller;
    public $view;
    public $header = 'header.php';
    public $footer = 'footer.php';

    static public function getPage() {
        if (!isset(self::$_Page)) self::$_Page = new self();
        return self::$_Page;
    }

    private function __construct() {
        $c = 'index.php';
        $v = 'index.php';
        if (isset($_GET['page'])) {
            $pid = $_GET['page'];
            if ($pid=='actu') {
                $v = 'actu.php';
            } elseif ($pid=='concept') {
                $v = 'concept.php';
            } elseif ($pid=='contact') {
                $v = 'contact.php';
            } elseif ($pid=='livredor') {
                $v = 'livredor.php';
            } elseif ($pid=='media') {
                $v = 'media.php';
			} elseif ($pid=='madetv'){
				$v = 'madetv.php';
            } elseif ($pid=='noservices') {
                $v = 'noservices.php';
            } elseif ($pid=='echanges') {
                $v = 'echanges.php';
            } elseif ($pid=='inscription') {
				$c = 'inscription.php';
                $v = 'inscription.php';
            } elseif ($pid=='profil') {
				$v = 'profil.php';			
			} elseif ($pid=='videos') {
				$v = 'videos.php';
			} elseif ($pid=='photos') {
				$v = 'photos.php';
			} elseif ($pid=='musicLib'){
				$v = 'musicLib.php';
			} elseif ($pid=='profilSelected'){
				$v = 'profilSelected.php';
			} else {
                $pid = 'index';
            }
        } else {
            $pid = 'index';
        }

       /*if ($pid=='index') {
           $this->header = 'header_index.php';
           $this->footer = 'footer_index.php';
       }*/
        $this->controller = $c;
        $this->view       = $v;
        $this->pid        = $pid;
    }

}

?>